package com.chenjinyan.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @ClassName UploadFilePathConfig
 * @Description TODO
 * @Date 2019/5/23 23:14
 * @Version 1.0
 */
@Configuration
public class UploadFilePathConfig extends WebMvcConfigurerAdapter {

    private String staticAccessPath = "/pic/goods/images/upload/**";
    private String uploadFolder = "/pic/goods/images/upload/";

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(staticAccessPath).addResourceLocations("file:" + uploadFolder);
    }
}
